package com.powernode.controller;

import com.powernode.document.ProductDoc;
import com.powernode.dto.PageResult;
import com.powernode.dto.Result;
import com.powernode.param.ProductSearchParam;
import com.powernode.service.ProductDocService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/search/app/products")
public class ProductSearchController {
    @Autowired
    private ProductDocService service;

    @GetMapping
    public Result<PageResult<ProductDoc>> search(ProductSearchParam param){
        return Result.success(service.search(param));
    }

}
